package com.zr.util;

/**
 * Created by 非常狂躁的猪 on 2019/12/25.
 */
public enum ErrorMessageEnum {
   QIYONG("启用",0),JINYONG("禁用",1),GONGCHANGNO("该工厂不存在",3),FARENNO("请输入正确的法人",4),GONGCHANGBIANMA("工厂编码不允许重复",5);

    private String name;
    private Integer value;

    //枚举必须有构造方法
    private ErrorMessageEnum(String name,Integer value) {
        this.name = name;
        this.value = value;
    }

    //普通方法,通过value获取名称
    public static String getName(Integer value){
        for (ErrorMessageEnum c:ErrorMessageEnum.values()){
            if (c.getValue() == value ){
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }
}






































